package com.upc.tp.timeplanning.mapper;

import com.upc.tp.timeplanning.entity.Student;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface StudentMapper {

    @Select("SELECT * FROM student")
    List<Student> getAll();

    @Select("SELECT * from student where username = #{username} ")
    Student getByUsername(@Param("username")String username);

    @Insert("INSERT INTO student(username,password) VALUES(#{username},#{password})")
    int insert(@Param("username")String username, @Param("password")String password);
}
